/*
 	This file is part of ExportGnuCash.

    ExportGnuCash is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ExportGnuCash is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ExportGnuCash.  If not, see <http://www.gnu.org/licenses/>.
 */
package net.sourceforge.gnucash.model;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;


/**
 * GnuCashToQIF conversion configuration object
 */
public class GnuCashBook
{
    /** Unused account pruning configuration option */
    public boolean pruneUnusedAccounts = true;
    
    /** Split memos from descriptions */
    public boolean splitMemoFromDescription = true;

    /** The accounts, using their GUIDs as the key */
    public Map<String,Account> accounts = new HashMap<String,Account>();
    
    /** The accounts, using their name as the key */
    public Map<String,Account> accountsByName = new HashMap<String,Account>();

    /** The transactions, using their GUIDs as the key */
    public Map<String,Transaction> transactions = new HashMap<String,Transaction>();
    
    /** Set of warnings that come up during processing */
    private SortedSet warnings = new TreeSet();

    /** Sorted Set of accounts */
    public SortedSet accountSet = null;
    
    /** Set of vendors */
    public Set vendors = new HashSet();
    
    /** Map of lot GUIDs to Lot objects */
    public Map lots = new HashMap();
    
    /** Map of invoice GUIDs to invoices */
    public Map invoices = new HashMap();

	public Account getAccountByUUID(String guid) {
		return accounts.get(guid);
	}

	public void setWarnings(SortedSet warnings) {
		this.warnings = warnings;
	}

	public SortedSet getWarnings() {
		return warnings;
	}
}
